/* 导入CSS变量定义 */
@import "./variables.css";

:root {
  overflow-y: auto;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  line-height: 1.6;
  font-weight: 400;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--header-bg);
}

body {
  height: 100%;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
}

#app {
  /* max-width: 1400px; */
  width: 100%;
  margin: 0 auto;
  height: 100%;
  box-sizing: border-box;
  position: relative;
}

/* 工具类 */
.flex {
  display: flex;
}

.flex-row {
  flex-direction: row;
}

.flex-col {
  flex-direction: column;
}

.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.items-end {
  align-items: flex-end;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.grow {
  flex-grow: 1;
}

.shrink {
  flex-shrink: 1;
}

/* 动画和过渡 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-enter-active,
.slide-leave-active {
  transition: transform 0.2s ease;
}

.slide-enter-from {
  transform: translateX(-100%);
}

.slide-leave-to {
  transform: translateX(100%);
}

/* 美化滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 1px;
}

:root:not(.dark) ::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 1px;
}

:root:not(.dark) ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* 深色模式滚动条 */
:root.dark ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0);
  border-radius: 1px;
}

:root.dark ::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #7c8aac 0%, #646e8a 100%);
  border-radius: 1px;
}

:root.dark ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #8b9df5 0%, #a97dd4 100%);
}

/* 通用卡片样式和悬停效果 */
.modern-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.modern-card:hover,
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* 按钮增强 */
.modern-button {
  border-radius: var(--border-radius-md);
  transition: all 0.2s ease;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.modern-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* 输入框增强 */
.modern-input {
  border-radius: var(--border-radius-md);
  transition: all 0.2s ease;
}

.modern-input:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 选择文本样式 - 浅色模式 */
:root:not(.dark) ::selection {
  background: rgba(102, 126, 234, 0.2);
  color: #1e293b;
}

:root:not(.dark) ::-moz-selection {
  background: rgba(102, 126, 234, 0.2);
  color: #1e293b;
}

/* 选择文本样式 - 暗黑模式 */
:root.dark ::selection {
  background: #4a90e2;
  color: #ffffff;
}

:root.dark ::-moz-selection {
  background: #4a90e2;
  color: #ffffff;
}

/* Focus样式增强 */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid rgba(102, 126, 234, 0.5);
  outline-offset: 2px;
}

/* 加载状态样式 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* 响应式网格 */
.responsive-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 640px) {
  .responsive-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* 文本渐变 */
.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 玻璃态效果 */
.glass-effect {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 悬停效果增强 */
.hover-lift {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* 脉冲动画 */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 旋转动画 */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

/* 弹跳动画 */
@keyframes bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  40%,
  43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

.bounce {
  animation: bounce 1s ease-in-out;
}

.n-layout-scroll-container {
  overflow: hidden;
}
